﻿using MicroCloud.Extensions;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace MicroCloud.Tests
{
    public class AppUnitTestBase
    {
        public AppUnitTestBase()
        {
            IServiceCollection services = new ServiceCollection();
            services.AddHttpContextAccessor().AddLogging();
            services.AddMicroCloud();

            IServiceProvider provider = services.BuildServiceProvider();
            provider.UseMicroCloud();

            ServiceProvider = provider;
        }

        /// <summary>
        /// 获取 服务提供者
        /// </summary>
        protected IServiceProvider ServiceProvider { get; private set; }
    }
    
}
